//
//  TravelLikeButton.m
//  TravelFollowYourHeart
//
//  Created by ENERGY on 2017/12/18.
//  Copyright © 2017年 Lwx. All rights reserved.
//

#import "TravelLikeButton.h"
#define likeBtnImageW 25

@implementation TravelLikeButton

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        self.imageView.contentMode = UIViewContentModeCenter;
//        self.titleLabel.textAlignment = NSTextAlignmentRight;
        
    }return self;
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleX = likeBtnImageW;
    CGFloat titleY = 0;
    CGFloat titleW = contentRect.size.width - likeBtnImageW;
    CGFloat titleH = contentRect.size.height;
    return CGRectMake(titleX, titleY, titleW, titleH);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageX = 0;
    CGFloat imageY = 0;
    CGFloat imageW = likeBtnImageW;
    CGFloat imageH = contentRect.size.height;
    return CGRectMake(imageX, imageY, imageW, imageH);
}


@end
